package cn.jboa.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

@Entity
@Table(name = "BIZ_CLAIM_VOUCHER_DETAIL", schema = "SCOTT", catalog = "")
public class BizClaimVoucherDetail {
    private int id;
    private String item;
    private long account;
    private String des;
    private BizClaimVoucher bizClaimVoucher;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="main_id")
    public BizClaimVoucher getBizClaimVoucher() {
        return bizClaimVoucher;
    }

    public void setBizClaimVoucher(BizClaimVoucher bizClaimVoucher) {
        this.bizClaimVoucher = bizClaimVoucher;
    }

    @Id
    @Column(name = "ID")
    @GenericGenerator(name="incrementName",strategy="increment")
    @GeneratedValue(generator="incrementName")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ITEM")
    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    @Basic
    @Column(name = "ACCOUNT")
    public long getAccount() {
        return account;
    }

    public void setAccount(long account) {
        this.account = account;
    }

    @Basic
    @Column(name = "DES")
    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BizClaimVoucherDetail that = (BizClaimVoucherDetail) o;

        if (id != that.id) return false;
        if (account != that.account) return false;
        if (item != null ? !item.equals(that.item) : that.item != null) return false;
        if (des != null ? !des.equals(that.des) : that.des != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (item != null ? item.hashCode() : 0);
        result = 31 * result + (int) (account ^ (account >>> 32));
        result = 31 * result + (des != null ? des.hashCode() : 0);
        return result;
    }
}
